<template>
  <ele-modal
    :width="1200"
    :visible="visible"
    :confirm-loading="loading"
    title="选择会员"
    :body-style="{ paddingBottom: '8px' }"
    @update:visible="updateVisible"
    @ok="save"
  >
    <a-form
      :label-col="{ md: { span: 7 }, sm: { span: 4 }, xs: { span: 24 } }"
      :wrapper-col="{ md: { span: 17 }, sm: { span: 20 }, xs: { span: 24 } }"
    >
      <a-row :gutter="24">
        <a-col :md="24" :sm="24" :xs="24">
          <zbTable
            ref="tableRef"
            :api-fun="get_member_select"
						:memberVal="props.memberVal"
            @getselection="getselection"
          />
        </a-col>
      </a-row>
    </a-form>
  </ele-modal>
</template>

<script setup>
  import { ref, unref, reactive, onMounted } from 'vue';
  import { Form } from 'ant-design-vue';
  import { message, Modal } from 'ant-design-vue';
  import { emailReg, phoneReg, identityReg } from 'ele-admin-pro';
  import { useRouter } from 'vue-router';
  import zbTable from './jewelrySelMemberIndex.vue';
  import { get_member_select } from '@/api/order/order/jewelry_order';

  const tableRef = ref(null);
  // 表格列配置
  const useForm = Form.useForm;

  const props = defineProps({
    // 弹窗是否打开
    visible: Boolean,
    memberVal: String
  });

  const emit = defineEmits(['update:visible', 'getMember']);
  const { currentRoute, push } = useRouter();
  const { query } = unref(currentRoute);
  const selectVal = ref({});

  // 提交状态
  const loading = ref(false);

  const getselection = (val) => {
    selectVal.value = val;
  };
  const save = () => {
    emit('getMember', selectVal.value);
  };
  /* 更新visible */
  const updateVisible = (value) => {
    emit('update:visible', value);
  };
</script>
<style scoped></style>
